<!DOCTYPE html>
<html lang="en">
<head>
	<meta charset="UTF-8">
	<title>Document</title>


    <meta charset="utf-8">
	<meta http-equiv="X-UA-Compatible" content="IE=edge">
	<meta name="viewport" content="width=device-width, initial-scale=1">
	<!-- 上述3个meta标签*必须*放在最前面，任何其他内容都*必须*跟随其后！ -->
	<title>Bootstrap 101 Template</title>

	<!-- Bootstrap -->
	<link href="__CSS__/bootstrap.min.css" rel="stylesheet">
	<link rel="stylesheet" href="__CSS__/my.css">
	<!-- HTML5 shim and Respond.js for IE8 support of HTML5 elements and media queries -->
	<!-- WARNING: Respond.js doesn't work if you view the page via file:// -->
	<!--[if lt IE 9]>
	<script src="http://cdn.bootcss.com/html5shiv/3.7.2/html5shiv.min.js"></script>
	<script src="http://cdn.bootcss.com/respond.js/1.4.2/respond.min.js"></script>
	<![endif]-->
	<!-- jQuery (necessary for Bootstrap's JavaScript plugins) -->
	<script src="__JS__/jquery.min.js"></script>
	<!-- Include all compiled plugins (below), or include individual files as needed -->
	<script src="__JS__/bootstrap.min.js"></script>
	
</head>
<body>

  <div class="container">
      	 <div class="col-md-12 bg-primary p10">
      	 	<h6>评论列表</h6>

      	 </div>
      	   	 <div class="col-md-12">
      	 	<table class="table table-hover bg-info">
      	 		<tr>
      	 			<th>ID</th>
      	 			<th>MID</th>
      	 			<th>UID</th>
      	 			<th>OID</th>
      	 			<th>创建时间</th>
      	 			<th>内容</th>
      	 			<th>状态</th>
      	 	    <th>操作</th>
      	 		</tr>
      	 		
      	       {foreach $list as $v}
                <tr>
                	  <td>{$v['id']}</td>
                    <td>{$v['mid']}</td>
                    <td>{$v['uid']}</td>
                    <td>{$v['oid']}</td>
                    <td>{$v['createtime']}</td>
                    <td>{$v['pinglun']}</td>
                    <td>{$v['status']}</td>
            
                    <td>
	                                             
		                    <button data-id="{$v['id']}" class="btn btn-danger btn-xs del">删除
		                  
		                    </button>
	               
                    </td>
                 
                </tr>
                {/foreach}

      	 	</table>
      	 </div>
  </div>




  <script>
  	   	$(function(){
            //触发用户权限修改
            $('.del').click(function(){
             var ac_id = $(this).attr('data-id');
            if (confirm('您确定删除么?')) {
            	 var obj = $(this).parents('tr');
            	delAjax(ac_id,obj);//执行拉黑操作
           	 	}         
            })
      	});

        function delAjax(id,obj)
        {
          $.ajax({
            type:'delete',
            url:'/admin/Pinglun/delete/id/' + id,
            // dateType:'json',

            success:function(data){
              if (data.status) {
                 alert('删除成功!!!');
                 obj.remove();
              }else{
                 alert('删除失败!!!');
              }
            },

            error:function(){
              //Ajax执行失败
              alert('Ajax执行失败')
            }

          });
        }
  </script>
	
</body>
</html>